package mspbots.data.tl.prod.hubspot.listener;

import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import mspbots.data.tl.entity.ResultEntity;
import mspbots.data.tl.prod.hubspot.service.HubspotTicketService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

@Log4j2
@Service
@Component
@RequiredArgsConstructor
public class HubspotSyncListenner {

    private final HubspotTicketService hubspotTicketService;

    @RabbitListener(queues = "hub-spot.tickets.tl")
    public void syncHubspotTicket(ResultEntity entity) {
        hubspotTicketService.sync(entity);
    }

}
